window.onload=function(){
    let mydiv = document.getElementById("mydiv")
    console.log(typeof mydiv)
    if(mydiv instanceof HTMLElement){
        mydiv.style.backgroundColor = "blue"
        mydiv.style.color = "white"
    }
}